using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._SpatialStatisticsTools._MappingClusters
{
    /// <summary>
    /// <para>Build Balanced Zones</para>
    /// <para>Creates spatially contiguous zones in your study area using a genetic growth algorithm based on criteria that you specify.</para>
    /// <para>使用基于您指定的条件的遗传生长算法在研究区域中创建空间连续区域。</para>
    /// </summary>    
    [DisplayName("Build Balanced Zones")]
    public class BuildBalancedZones : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public BuildBalancedZones()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_features">
        /// <para>Input Features</para>
        /// <para>The feature class or feature layer that will be aggregated into zones.</para>
        /// <para>将聚合到区域中的要素类或要素图层。</para>
        /// </param>
        /// <param name="_output_features">
        /// <para>Output Features</para>
        /// <para>The output feature class indicating which features are aggregated into each zone. The feature class will be symbolized by the ZONE_ID field and will contain fields displaying the values of each criteria that you specify.</para>
        /// <para>输出要素类，指示将哪些要素聚合到每个区域中。要素类将由ZONE_ID字段符号化，并且将包含显示您指定的每个条件值的字段。</para>
        /// </param>
        /// <param name="_zone_creation_method">
        /// <para>Zone Creation Method</para>
        /// <para><xdoc>
        ///   <para>Specifies the method that will be used to grow each zone. Zones grow until all specified criteria are satisfied.</para>
        ///   <bulletList>
        ///     <bullet_item>Attribute target—Zones will be created based on target values of one or multiple variables. If this option is chosen, the desired sum of each attribute must be specified in the Zone Building Criteria With Target parameter, and each zone will grow until the sum of the attributes exceeds these values. For example, you can use this option to create zones that each have at least 100,000 residents and 20,000 family homes.</bullet_item><para/>
        ///     <bullet_item>Number of zones and attribute target—A specified number of zones will be created while keeping the sum of an attribute approximately equal within each zone. If this option is chosen, the desired number of zones must be specified in the Target Number of Zones parameter. The attribute sum within each zone is equal to the sum of the total attribute divided by the number of zones.</bullet_item><para/>
        ///     <bullet_item>Defined number of zones—A specified number of zones will be created that are each composed of approximately the same number of input features. If this option is chosen, the desired number of zones must be specified in the Target Number of Zones parameter.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将用于扩展每个区域的方法。区域会不断增长，直到满足所有指定的条件。</para>
        ///   <bulletList>
        ///     <bullet_item>属性目标 - 将根据一个或多个变量的目标值创建区域。如果选择此选项，则必须在 Zone Building Criteria With Target 参数中指定每个属性的所需总和，并且每个区域将不断增长，直到属性的总和超过这些值。例如，您可以使用此选项创建每个区域至少有 100,000 名居民和 20,000 个家庭住宅。</bullet_item><para/>
        ///     <bullet_item>区域数和属性目标 - 将创建指定数量的区域，同时保持每个区域内属性的总和大致相等。如果选择此选项，则必须在目标区域数参数中指定所需的区域数。每个区域内的属性总和等于总属性的总和除以区域数。</bullet_item><para/>
        ///     <bullet_item>定义的区域数 - 将创建指定数量的区域，每个区域由大致相同数量的输入要素组成。如果选择此选项，则必须在目标区域数参数中指定所需的区域数。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// </param>
        public BuildBalancedZones(object _in_features, object _output_features, _zone_creation_method_value _zone_creation_method)
        {
            this._in_features = _in_features;
            this._output_features = _output_features;
            this._zone_creation_method = _zone_creation_method;
        }
        public override string ToolboxName => "Spatial Statistics Tools";

        public override string ToolName => "Build Balanced Zones";

        public override string CallName => "stats.BuildBalancedZones";

        public override List<string> AcceptEnvironments => ["outputCoordinateSystem", "parallelProcessingFactor", "randomGenerator"];

        public override object[] ParameterInfo => [_in_features, _output_features, _zone_creation_method.GetGPValue(), _number_of_zones, _zone_building_criteria_target, _zone_building_criteria, _spatial_constraints.GetGPValue(), _weights_matrix_file, _zone_characteristics, _attribute_to_consider, _distance_to_consider, _categorial_variable, _proportion_method.GetGPValue(), _population_size, _number_generations, _mutation_factor, _output_convergence_table];

        /// <summary>
        /// <para>Input Features</para>
        /// <para>The feature class or feature layer that will be aggregated into zones.</para>
        /// <para>将聚合到区域中的要素类或要素图层。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_features { get; set; }


        /// <summary>
        /// <para>Output Features</para>
        /// <para>The output feature class indicating which features are aggregated into each zone. The feature class will be symbolized by the ZONE_ID field and will contain fields displaying the values of each criteria that you specify.</para>
        /// <para>输出要素类，指示将哪些要素聚合到每个区域中。要素类将由ZONE_ID字段符号化，并且将包含显示您指定的每个条件值的字段。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _output_features { get; set; }


        /// <summary>
        /// <para>Zone Creation Method</para>
        /// <para><xdoc>
        ///   <para>Specifies the method that will be used to grow each zone. Zones grow until all specified criteria are satisfied.</para>
        ///   <bulletList>
        ///     <bullet_item>Attribute target—Zones will be created based on target values of one or multiple variables. If this option is chosen, the desired sum of each attribute must be specified in the Zone Building Criteria With Target parameter, and each zone will grow until the sum of the attributes exceeds these values. For example, you can use this option to create zones that each have at least 100,000 residents and 20,000 family homes.</bullet_item><para/>
        ///     <bullet_item>Number of zones and attribute target—A specified number of zones will be created while keeping the sum of an attribute approximately equal within each zone. If this option is chosen, the desired number of zones must be specified in the Target Number of Zones parameter. The attribute sum within each zone is equal to the sum of the total attribute divided by the number of zones.</bullet_item><para/>
        ///     <bullet_item>Defined number of zones—A specified number of zones will be created that are each composed of approximately the same number of input features. If this option is chosen, the desired number of zones must be specified in the Target Number of Zones parameter.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将用于扩展每个区域的方法。区域会不断增长，直到满足所有指定的条件。</para>
        ///   <bulletList>
        ///     <bullet_item>属性目标 - 将根据一个或多个变量的目标值创建区域。如果选择此选项，则必须在 Zone Building Criteria With Target 参数中指定每个属性的所需总和，并且每个区域将不断增长，直到属性的总和超过这些值。例如，您可以使用此选项创建每个区域至少有 100,000 名居民和 20,000 个家庭住宅。</bullet_item><para/>
        ///     <bullet_item>区域数和属性目标 - 将创建指定数量的区域，同时保持每个区域内属性的总和大致相等。如果选择此选项，则必须在目标区域数参数中指定所需的区域数。每个区域内的属性总和等于总属性的总和除以区域数。</bullet_item><para/>
        ///     <bullet_item>定义的区域数 - 将创建指定数量的区域，每个区域由大致相同数量的输入要素组成。如果选择此选项，则必须在目标区域数参数中指定所需的区域数。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Zone Creation Method")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public _zone_creation_method_value _zone_creation_method { get; set; }

        public enum _zone_creation_method_value
        {
            /// <summary>
            /// <para>Attribute target</para>
            /// <para>Attribute target—Zones will be created based on target values of one or multiple variables. If this option is chosen, the desired sum of each attribute must be specified in the Zone Building Criteria With Target parameter, and each zone will grow until the sum of the attributes exceeds these values. For example, you can use this option to create zones that each have at least 100,000 residents and 20,000 family homes.</para>
            /// <para>属性目标 - 将根据一个或多个变量的目标值创建区域。如果选择此选项，则必须在 Zone Building Criteria With Target 参数中指定每个属性的所需总和，并且每个区域将不断增长，直到属性的总和超过这些值。例如，您可以使用此选项创建每个区域至少有 100,000 名居民和 20,000 个家庭住宅。</para>
            /// </summary>
            [Description("Attribute target")]
            [GPEnumValue("ATTRIBUTE_TARGET")]
            _ATTRIBUTE_TARGET,

            /// <summary>
            /// <para>Number of zones and attribute target</para>
            /// <para>Number of zones and attribute target—A specified number of zones will be created while keeping the sum of an attribute approximately equal within each zone. If this option is chosen, the desired number of zones must be specified in the Target Number of Zones parameter. The attribute sum within each zone is equal to the sum of the total attribute divided by the number of zones.</para>
            /// <para>区域数和属性目标 - 将创建指定数量的区域，同时保持每个区域内属性的总和大致相等。如果选择此选项，则必须在目标区域数参数中指定所需的区域数。每个区域内的属性总和等于总属性的总和除以区域数。</para>
            /// </summary>
            [Description("Number of zones and attribute target")]
            [GPEnumValue("NUMBER_ZONES_AND_ATTRIBUTE")]
            _NUMBER_ZONES_AND_ATTRIBUTE,

            /// <summary>
            /// <para>Defined number of zones</para>
            /// <para>Defined number of zones—A specified number of zones will be created that are each composed of approximately the same number of input features. If this option is chosen, the desired number of zones must be specified in the Target Number of Zones parameter.</para>
            /// <para>定义的区域数 - 将创建指定数量的区域，每个区域由大致相同数量的输入要素组成。如果选择此选项，则必须在目标区域数参数中指定所需的区域数。</para>
            /// </summary>
            [Description("Defined number of zones")]
            [GPEnumValue("NUMBER_OF_ZONES")]
            _NUMBER_OF_ZONES,

        }

        /// <summary>
        /// <para>Target Number of Zones</para>
        /// <para>The number of zones that will be created.</para>
        /// <para>将创建的区域数。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Target Number of Zones")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long? _number_of_zones { get; set; } = null;


        /// <summary>
        /// <para>Zone Building Criteria With Target</para>
        /// <para>Specifies the variables that will be considered, their target values, and optional weights. The default weights are set to 1, and each variable contributes equally unless they are changed.</para>
        /// <para>指定要考虑的变量、其目标值和可选权重。默认权重设置为 1，除非更改，否则每个变量的贡献相同。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Zone Building Criteria With Target")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _zone_building_criteria_target { get; set; } = null;


        /// <summary>
        /// <para>Zone Building Criteria</para>
        /// <para>Specifies the variables that will be considered and, optionally, weights. The default weights are set to 1, and each variable contributes equally unless changed.</para>
        /// <para>指定要考虑的变量以及权重（可选）。默认权重设置为 1，除非更改，否则每个变量的贡献相等。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Zone Building Criteria")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _zone_building_criteria { get; set; } = null;


        /// <summary>
        /// <para>Spatial Constraints</para>
        /// <para><xdoc>
        ///   <para>Specifies how neighbors are defined while the zones grow. Zones can only grow into new features that are neighbors of at least one of the features already in the zone. If the input features are polygons, the default spatial constraint is Contiguity edges corners. If the input features are points, the default spatial constraint is Trimmed Delaunay triangulation.</para>
        ///   <bulletList>
        ///     <bullet_item>Contiguity edges only—For zones containing contiguous polygon features, only polygons that share an edge will be part of the same zone.</bullet_item><para/>
        ///     <bullet_item>Contiguity edges corners— For zones containing contiguous polygon features, only polygons that share an edge or a vertex will be part of the same zone.</bullet_item><para/>
        ///     <bullet_item>Trimmed Delaunay triangulation— Features in the same zone will have at least one natural neighbor in common with another feature in the zone. Natural neighbor relationships are based on a trimmed Delaunay Triangulation. Conceptually, Delaunay Triangulation creates a non-overlapping mesh of triangles from feature centroids. Each feature is a triangle node, and nodes that share edges are considered neighbors. These triangles are then clipped to a convex hull to ensure that features cannot be neighbors with any features outside of the convex hull. This is the default.</bullet_item><para/>
        ///     <bullet_item>Get spatial weights from file— Spatial, and, optionally, temporal relationships will be defined by a specified spatial weights file (.swm). Create the spatial weights matrix using the Generate Spatial Weights Matrix tool or the Generate Network Spatial Weights tool. The path to the spatial weights file is specified by the Spatial Weights Matrix File parameter.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定在区域增长时如何定义邻居。区域只能发展为与区域中已有的至少一个要素相邻的新要素。如果输入要素为面，则默认空间约束为邻接边角。如果输入要素为点，则默认空间约束为修剪的 Delaunay 三角剖分。</para>
        ///   <bulletList>
        ///     <bullet_item>仅邻接边—对于包含连续面要素的区域，只有共享边的面才能成为同一区域的一部分。</bullet_item><para/>
        ///     <bullet_item>邻接边角 - 对于包含连续面要素的区域，只有共享边或顶点的面才能成为同一区域的一部分。</bullet_item><para/>
        ///     <bullet_item>修剪的 Delaunay 三角剖分 - 同一区域中的要素将至少具有一个与该区域中另一个要素相同的自然邻居。自然邻域关系基于修剪后的 Delaunay 三角剖分。从概念上讲，Delaunay 三角剖分从特征质心创建三角形的非重叠网格。每个要素都是一个三角形节点，共享边的节点被视为相邻节点。然后将这些三角形剪裁到凸包上，以确保要素不能与凸包外部的任何要素相邻。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>从文件中获取空间权重 - 空间关系和时间关系（可选）将由指定的空间权重文件 （.swm） 定义。使用生成空间权重矩阵工具或生成网络空间权重工具创建空间权重矩阵。空间权重文件的路径由空间权重矩阵文件参数指定。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Spatial Constraints")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _spatial_constraints_value? _spatial_constraints { get; set; } = null;

        public enum _spatial_constraints_value
        {
            /// <summary>
            /// <para>Contiguity edges only</para>
            /// <para>Contiguity edges only—For zones containing contiguous polygon features, only polygons that share an edge will be part of the same zone.</para>
            /// <para>仅邻接边—对于包含连续面要素的区域，只有共享边的面才能成为同一区域的一部分。</para>
            /// </summary>
            [Description("Contiguity edges only")]
            [GPEnumValue("CONTIGUITY_EDGES_ONLY")]
            _CONTIGUITY_EDGES_ONLY,

            /// <summary>
            /// <para>Contiguity edges corners</para>
            /// <para>Contiguity edges corners— For zones containing contiguous polygon features, only polygons that share an edge or a vertex will be part of the same zone.</para>
            /// <para>邻接边角 - 对于包含连续面要素的区域，只有共享边或顶点的面才能成为同一区域的一部分。</para>
            /// </summary>
            [Description("Contiguity edges corners")]
            [GPEnumValue("CONTIGUITY_EDGES_CORNERS")]
            _CONTIGUITY_EDGES_CORNERS,

            /// <summary>
            /// <para>Trimmed Delaunay triangulation</para>
            /// <para>Trimmed Delaunay triangulation— Features in the same zone will have at least one natural neighbor in common with another feature in the zone. Natural neighbor relationships are based on a trimmed Delaunay Triangulation. Conceptually, Delaunay Triangulation creates a non-overlapping mesh of triangles from feature centroids. Each feature is a triangle node, and nodes that share edges are considered neighbors. These triangles are then clipped to a convex hull to ensure that features cannot be neighbors with any features outside of the convex hull. This is the default.</para>
            /// <para>修剪的 Delaunay 三角剖分 - 同一区域中的要素将至少具有一个与该区域中另一个要素相同的自然邻居。自然邻域关系基于修剪后的 Delaunay 三角剖分。从概念上讲，Delaunay 三角剖分从特征质心创建三角形的非重叠网格。每个要素都是一个三角形节点，共享边的节点被视为相邻节点。然后将这些三角形剪裁到凸包上，以确保要素不能与凸包外部的任何要素相邻。这是默认设置。</para>
            /// </summary>
            [Description("Trimmed Delaunay triangulation")]
            [GPEnumValue("TRIMMED_DELAUNAY_TRIANGULATION")]
            _TRIMMED_DELAUNAY_TRIANGULATION,

            /// <summary>
            /// <para>Get spatial weights from file</para>
            /// <para>Get spatial weights from file— Spatial, and, optionally, temporal relationships will be defined by a specified spatial weights file (.swm). Create the spatial weights matrix using the Generate Spatial Weights Matrix tool or the Generate Network Spatial Weights tool. The path to the spatial weights file is specified by the Spatial Weights Matrix File parameter.</para>
            /// <para>从文件中获取空间权重 - 空间关系和时间关系（可选）将由指定的空间权重文件 （.swm） 定义。使用生成空间权重矩阵工具或生成网络空间权重工具创建空间权重矩阵。空间权重文件的路径由空间权重矩阵文件参数指定。</para>
            /// </summary>
            [Description("Get spatial weights from file")]
            [GPEnumValue("GET_SPATIAL_WEIGHTS_FROM_FILE")]
            _GET_SPATIAL_WEIGHTS_FROM_FILE,

        }

        /// <summary>
        /// <para>Spatial Weight Matrix File</para>
        /// <para>The path to a file containing spatial weights that define spatial and, optionally, temporal relationships among features.</para>
        /// <para>包含空间权重的文件的路径，用于定义要素之间的空间关系和时间关系（可选）。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Spatial Weight Matrix File")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _weights_matrix_file { get; set; } = null;


        /// <summary>
        /// <para>Zone Characteristics</para>
        /// <para><xdoc>
        ///   <para>Specifies the desired characteristics of the zones that will be created.</para>
        ///   <bulletList>
        ///     <bullet_item>Equal area— Zones with total area as similar as possible will be created.</bullet_item><para/>
        ///     <bullet_item>Compactness—Zones will be created with more closely-packed (compact) features.</bullet_item><para/>
        ///     <bullet_item>Equal number of features—Zones with an equal number of features will be created.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将要创建的区域的所需特征。</para>
        ///   <bulletList>
        ///     <bullet_item>相等面积 - 将创建总面积尽可能相似的区域。</bullet_item><para/>
        ///     <bullet_item>紧凑性—将创建具有更紧密（紧凑）特征的区域。</bullet_item><para/>
        ///     <bullet_item>要素数相等—将创建要素数相等的区域。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Zone Characteristics")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _zone_characteristics { get; set; } = null;


        /// <summary>
        /// <para>Attribute to Consider</para>
        /// <para>Specifies attributes and statistics to consider in the selection of final zones. You can choose to homogenize attributes based on their sum, average, median, or variance. For example, if you are creating zones based on home values and want to balance the average total income within each zone, the solution with the most equal average income across zones will be preferred.</para>
        /// <para>指定在选择最终区域时要考虑的属性和统计信息。您可以选择根据属性的总和、平均值、中位数或方差对属性进行同质化。例如，如果您要根据房屋价值创建区域，并希望平衡每个区域内的平均总收入，则首选跨区域平均收入最相等的解决方案。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Attribute to Consider")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _attribute_to_consider { get; set; } = null;


        /// <summary>
        /// <para>Distance to Consider</para>
        /// <para><xdoc>
        ///   <para>The feature class that will be used to homogenize the total distance per zone. The distance is calculated from each of the input features to the closest feature provided in this parameter. This distance is then used as an additional attribute constraint when selecting the final zone solution. For example, you can create police patrol districts that are each approximately the same distance from the closest police station.</para>
        ///   <para>This optional parameter is not available with a Desktop Basic or Desktop Standard license.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将用于对每个区域的总距离进行均质化的要素类。计算从每个输入要素到此参数中提供的最近要素的距离。然后，在选择最终区域解时，此距离将用作附加属性约束。例如，您可以创建每个警察巡逻区，每个巡逻区与最近的警察局的距离大致相同。</para>
        ///   <para>此可选参数不适用于 Desktop Basic 或 Desktop Standard 许可证。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Distance to Consider")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _distance_to_consider { get; set; } = null;


        /// <summary>
        /// <para>Categorical Variable to Maintain Proportions</para>
        /// <para>The categorical variable to be considered for zone proportions.</para>
        /// <para>区域比例要考虑的分类变量。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Categorical Variable to Maintain Proportions")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _categorial_variable { get; set; } = null;


        /// <summary>
        /// <para>Proportion Method</para>
        /// <para><xdoc>
        ///   <para>Specifies the type of proportion that will be maintained based on the chosen categorical variable.</para>
        ///   <bulletList>
        ///     <bullet_item>Maintain within proportion—Each zone will maintain the same proportions as the overall study area for the given categorical variable. For example, given a categorical variable that is 60% Type A and 40% Type B, this method will prefer zones that are comprised of approximately 60% Type A features and 40% Type B features.</bullet_item><para/>
        ///     <bullet_item>Maintain overall proportion—Zones will be created so that the overall proportions of category predominance by zone matches the proportions of the given categorical variable for the entire dataset. For example, given a categorical variable that is 60% Type A and 40% Type B, this method will prefer solutions where 60% of the zones are predominantly Type A features and 40% of the zones are predominantly Type B features.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将根据所选分类变量维护的比例类型。</para>
        ///   <bulletList>
        ///     <bullet_item>保持在比例范围内—对于给定分类变量，每个区域将保持与整个研究区域相同的比例。例如，给定 60% A 型和 40% B 型的分类变量，此方法将优先选择由大约 60% 的 A 型特征和 40% 的 B 型特征组成的区域。</bullet_item><para/>
        ///     <bullet_item>保持总体比例 - 将创建区域，以便按区域划分的类别优势的总体比例与整个数据集中给定分类变量的比例相匹配。例如，给定一个分类变量为 60% 的 A 型和 40% 的 B 型，此方法将首选 60% 的区域主要是 A 型要素和 40% 的区域主要是 B 型要素的解决方案。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Proportion Method")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _proportion_method_value? _proportion_method { get; set; } = null;

        public enum _proportion_method_value
        {
            /// <summary>
            /// <para>Maintain within proportion</para>
            /// <para>Maintain within proportion—Each zone will maintain the same proportions as the overall study area for the given categorical variable. For example, given a categorical variable that is 60% Type A and 40% Type B, this method will prefer zones that are comprised of approximately 60% Type A features and 40% Type B features.</para>
            /// <para>保持在比例范围内—对于给定分类变量，每个区域将保持与整个研究区域相同的比例。例如，给定 60% A 型和 40% B 型的分类变量，此方法将优先选择由大约 60% 的 A 型特征和 40% 的 B 型特征组成的区域。</para>
            /// </summary>
            [Description("Maintain within proportion")]
            [GPEnumValue("MAINTAIN_WITHIN_PROPORTION")]
            _MAINTAIN_WITHIN_PROPORTION,

            /// <summary>
            /// <para>Maintain overall proportion</para>
            /// <para>Maintain overall proportion—Zones will be created so that the overall proportions of category predominance by zone matches the proportions of the given categorical variable for the entire dataset. For example, given a categorical variable that is 60% Type A and 40% Type B, this method will prefer solutions where 60% of the zones are predominantly Type A features and 40% of the zones are predominantly Type B features.</para>
            /// <para>保持总体比例 - 将创建区域，以便按区域划分的类别优势的总体比例与整个数据集中给定分类变量的比例相匹配。例如，给定一个分类变量为 60% 的 A 型和 40% 的 B 型，此方法将首选 60% 的区域主要是 A 型要素和 40% 的区域主要是 B 型要素的解决方案。</para>
            /// </summary>
            [Description("Maintain overall proportion")]
            [GPEnumValue("MAINTAIN_OVERALL_PROPORTION")]
            _MAINTAIN_OVERALL_PROPORTION,

        }

        /// <summary>
        /// <para>Population Size</para>
        /// <para>The number of randomly generated initial seeds. For larger datasets, increasing this number will increase the search space and the probability of finding a better solution. The default is 100.</para>
        /// <para>随机生成的初始种子数。对于较大的数据集，增加此数字将增加搜索空间和找到更好解决方案的可能性。默认值为 100。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Population Size")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long _population_size { get; set; } = 100;


        /// <summary>
        /// <para>Number of Generations</para>
        /// <para>The number of times the zone search process is repeated. For larger datasets, increasing the number is recommended in order to find an optimal solution. The default is 50 generations.</para>
        /// <para>重复区域搜索过程的次数。对于较大的数据集，建议增加数量以找到最佳解决方案。默认值为 50 代。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Number of Generations")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long _number_generations { get; set; } = 50;


        /// <summary>
        /// <para>Mutation Factor</para>
        /// <para>The probability that an individual's seed values will be mutated to a new set of seeds. Mutation increases the search space by introducing variability of the possible solutions in every generation and allows for faster convergence to an optimal solution. The default is 0.1.</para>
        /// <para>个体的种子值将变异为一组新种子的概率。突变通过在每一代中引入可能解的可变性来增加搜索空间，并允许更快地收敛到最佳解。默认值为 0.1。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Mutation Factor")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double _mutation_factor { get; set; } = 0.1;


        /// <summary>
        /// <para>Output Convergence Table</para>
        /// <para>If specified, a table will be created containing the total fitness score for the best solution found in every generation as well as the fitness score for the individual zone constraints.</para>
        /// <para>如果指定，将创建一个表，其中包含每一代中找到的最佳解决方案的总适应度分数以及各个区域约束的适应度分数。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Convergence Table")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _output_convergence_table { get; set; } = null;


        public BuildBalancedZones SetEnv(object outputCoordinateSystem = null, object parallelProcessingFactor = null, object randomGenerator = null)
        {
            base.SetEnv(outputCoordinateSystem: outputCoordinateSystem, parallelProcessingFactor: parallelProcessingFactor, randomGenerator: randomGenerator);
            return this;
        }

    }

}